1. Field of the Invention
The present invention relates to circuits for switching between clock signals during the execution of programs in a computer system. In particular, the present invention relates to a circuit for switching between two clock signals of different frequencies without generating a glitch signal, and thus, preventing timing errors in the central processing unit (CPU) or other components.
2. Description of Related Art
A computer system includes many complex digital circuits whose operation is controlled by a clock signal of a certain frequency. The clock signal is usually generated by a crystal oscillator. For example, the microprocessor in most computer systems is driven by an external clock signal to facilitate timing and synchronization of the internal operations. The frequency of the clock signal generally indicates the processing speed of the computer system. The higher the frequency of the clock signal, the faster the execution speed and the greater the power consumption.
Present-day computer systems often provide multiple clock signals with different frequencies. For example, in personal computer systems, clock signal frequencies such as 8 MHz, 12 MHz, 16 MHz, 20 MHz, 25 MHz, 30 MHz, 33 MHz, among others are conventional. While executing programs on a computer system, it is often necessary to switch the system clock signal from one frequency to another for selecting the optimum clock speed for a particular program. For example, a user may execute a graphic drafting program, but the execution speed of the program is too slow at the existing rate of the clock signal. The clock signal should be switched from the existing low frequency (e.g., 12 MHz) to a higher frequency (e.g., 20 MHz) to increase the program's execution speed. Similarly, it may be desirable to change the clock rate from a higher speed to a slower speed. When operating at a high frequency in a computer video game program, the user may be unable to react to the speed of the game. The clock signal should be switched to a lower frequency to provide more time for the user to respond when playing with the game.
As shown in FIG. 1A, a conventional switching circuit 10 such as a multiplexer (MUX) receives a first and second clock signals (CLK1, CLK2) on leads 12 and 14, and a control signal on lead 16. The conventional switching circuit 10 outputs a clock signal (CLKOUT) on signal line 18. The control signal 16 can be generated by hardware or software according to the needs of the system designer. In FIG. 1B, a timing diagram of the wave forms for the control signal, CLK1 signal, CLK2 signal and CLKOUT signal shows the relationship between these signals. Multiplexer 10 outputs the CLK1 signal as the CLKOUT signal if the control signal 16 is high and outputs the CLK2 signal if the control signal 16 is low. The control signal 16 is initially high for outputting the CLK1 signal 12. When control signal 16 falls to a low potential, the CLK2 signal 14 is output on line 18. However, there is a short pulse or glitch 19 during the transition between the CLK1 signal and the CLK2 signal on the CLKOUT signal on line 18.
Generally, a glitch signal causes errors during execution of the processor and other components. Generally, designers assume that glitch signals will not occur when the system clock signal is changed between different frequencies. If a glitch signal appears in the CLKOUT signal, the processor and other components are often unable to complete their operations within the very short pulse width of the glitch, thus the timing of the entire computer system changes and produces unpredictable results.
Therefore, there is a need for a switching circuit for clock signals that does not produce a glitch signal.